<!DOCTYPE html>
<html lang="en">

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>KEN CASHIER</title>
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0,minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">

    <link rel="stylesheet" href="../../../../assets/modular/system/briCashDesk/phonecashier.css">
    <link rel="stylesheet" href="../../../../assets/modular/system/briCashDesk/layer.css">
    <script src="../../../../assets/modular/system/briCashDesk/jquery.min.js"></script>
    <script src="../../../../assets/modular/system/briCashDesk/clipboard.min.v2.js"></script>

    <!--    <link rel="stylesheet" href="../../../../assets/common/layui/css/layui.css"/>-->
    <!--    <link rel="stylesheet" href="../../../../assets/common/module/admin.css" media="all"/>-->
    <!--    <script type="text/javascript" src="../../../../assets/common/layui/layui.js"></script>-->
    <!--    <script type="text/javascript" src="../../../../assets/common/js/common.js"></script>-->
    <!--    <script type="text/javascript" src="../../../../assets/common/js/custom.js"></script>-->

</head>

<body>
<div class="container">
    <section id="logo" class="header">
        <div class="solpay-logo"></div>
    </section>
    <div class="main">
        <div class="total-amount">
            <div class="amount" style="font-size: 1.1rem">BRI order confirmation screen</div>
        </div>
        <div id="phone-layout" hidden="" style="display: none;">
            <div class="container-row input-prompt-box-title">Please enter a mobile phone account for transfer</div>
            <button class="pay-btn">pay</button>
        </div>
        <div id="order-layout" class="content" hidden="" style="display: block;">
            <div class="caption">
                <div>Make a payment of &nbsp;</div>
                <b class="amount">BRI 10000</b>
            </div>
            <div class="paymethod bank">
                <div class="item accountNameItem">
                    <div class="label">Account Name</div>
                    <div class="input">
                        <span name="accountName" class="accountName" style="font-size: 1.0rem"></span>

                        <div class="icons copy"><i class="icon icon-list"></i></div>
                    </div>
                </div>
                <div class="item accountNumberItem">
                    <div class="label">Account Number</div>
                    <div class="input"><span name="accountNumber" class="accountNumber"
                                             style="font-size: 1.0rem"></span>
                        <div class="icons copy"><i class="icon icon-list"></i></div>
                    </div>
                </div>
                <div class="item accountMoneyItem">
                    <div class="label">Account Money</div>
                    <div class="input"><span name="accountMoney" class="accountMoney"
                                             style="font-size: 1.0rem"></span>
                        <div class="icons copy"><i class="icon icon-list"></i></div>
                    </div>
                </div>

            </div>
            <div id="refNo-layout" style="margin-top: 50px">
                <div class="container-row input-box-input-box" style="margin-top: 10px"><input id="refNo"
                                                                                               class="refNo"
                                                                                               placeholder="Input Transaction id [ Eg :QGU0CK53HC ]"
                                                                                               oninput="if(value.length>10)value=value.slice(0,10)">
                </div>
                <div class="container-row input-prompt-box-title">After the payment is successful, if the order is
                    unsuccessful, please try to enter the Transaction id. Please do not pay twice for the order.
                </div>
                <button id="refNoBtn" disabled="true" class="ref-no-btn">have made the payment</button>
            </div>
        </div>
    </div>
</div>
</body>
<script>
    getUrlParam = function (name) {
        var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
        var r = window.location.search.substr(1).match(reg);
        if (r != null) {
            return unescape(r[2]);
        } else {
            return null;
        }
    };

    var accountName = getUrlParam("accountName");
    var accountNumber = getUrlParam("accountNumber");
    var accountMoney = getUrlParam("accountMoney");
    var id = getUrlParam("id");
    var amountSmall = getUrlParam("amountSmall");


    $('.accountName').text(accountName);
    $('.accountNumber').text(accountNumber);
    $('.accountMoney').text((parseInt(accountMoney) + parseInt(amountSmall)));

    $('#refNoBtn').click(function () {
        var data={
            "id": id,
            "account": accountNumber,
            "accountName": accountName,
            "amount": accountMoney,
            "orderId": $('.refNo').val(),
            "amountSmall": amountSmall
        };
        $.ajax({
            type: "post",//请求类型
            async: false,
            contentType:"application/json;charset=UTF-8",
            data: JSON.stringify(data),
            url: "/cdInfo/submitCd",
            dataType: "json",//返回的数据类型
            success: function (exportData) {
                console.log()
            },
            error: function (edata) {
                console.log("异常！" + edata.responseJSON.message);
            }
        });
    });

    $(function () {
        setTimeout(function () {
            $('#refNoBtn').attr("disabled", false)
        }, 3000)


    })
</script>
</html>